/**
 * Created by htdn033 on 14-11-19.
 */


function  validateAddAdmintForm()
{
    var userName = $("#userName").val();
    if(userName.length == 0)
    {
        alert("请输入账号");
        return false;
    }
    var userPasswd = $("#userPasswd").val();
    if(userPasswd.length == 0)
    {
        alert("请输入密码");
        return false;
    }
    if(userPasswd.length <6 )
    {
        alert("请输入6位到18位的密码");
        return false;
    }
    if( userPasswd.length>18 )
    {
        alert("请输入6位到18位的密码");
        return false;
    }

    var ConuserPasswd = $("#ConuserPasswd").val();
    if(ConuserPasswd.length == 0)
    {
        alert("请输入确认密码");
        return false;
    }
    if(ConuserPasswd!=userPasswd)
    {
        alert("密码和确认密码输入不一致");
        return false;
    }

    var userPhone = $("#userPhone").val();
    if(userPhone.length != 0)
    {
        if(userPhone.length != 11 ||  !(/^(13[0-9]|15[012356789]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/.test(userPhone)))
        {
            alert("请输入正确的手机号码");
            return false;
        }
    }
}